package com.dadao.mall.lambdademo;

import java.util.StringJoiner;

public class Cat {
    public boolean sex;
    public int age;

    public String name;

    public Cat(boolean sex,int age){
        this.sex = sex;
        this.age = age;
    }

    @Override
    public String toString() {
        StringJoiner sj = new StringJoiner(";");
        sj.add("性别：");
        sj.add(this.sex?"男":"nv");
        sj.add(" 年龄：").add(this.age+"");
        return sj.toString();
    }
}
